home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: What are the best C programming language books for beginner?
- Date: 14 Mar 1996 08:33:26 -0800
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4i9homINNa10@keats.ugrad.cs.ubc.ca>
- References: <313FA4BD.41C67EA6@dragon.taiwan.ti.com> <3a7cc$15141.38a@news.comet.net> <Pine.OSF.3.91.960313150356.30507A-100000@io.UWinnipeg.ca> <4i81un$4gc@solutions.solon.com>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4i81un$4gc@solutions.solon.com>,
- Peter Seebach <seebs@solutions.solon.com> wrote:
- >In article <Pine.OSF.3.91.960313150356.30507A-100000@io.UWinnipeg.ca>,
- >Bill Simpson <wsimpson@uwinnipeg.ca> wrote:
- >>A simple litmus test: look for int main(void). Unbelevably, you still
- >>get many versions other than this (including the holy K&R book, which the
- >>authors have not bothered to ANSI-ize so far as I know).
- >
- >K&R is fully ANSI, with one (1) exception I know of (*study* page 117.).
-
- There is a funny "a" character lying on its side in the top right corner.
-
- Ooh! I think I just spotted a ``*++argv[0]'' in there. Ouchie... These
- argv[] pointers are not modifiable. Is that it is there more?
-
- >I have found one piece of advice I disagree with, one mistake, and one
- >typo. (Missing " on page 114. I didn't find it; dmr pointed it out
- >when I sent in a bug report on the one on 117.)
- >
- >It has been ANSI-ized since before there was ANSI C.
-
- There is one more thing that I found. Somewhere in the book it suggests that
- you use a cast with malloc(), whereas ANSI doesn't require it. For example,
- on page 142 in the talloc function.
-
- The paragraph above reads:
-
- ``In C, the proper method is to declare that malloc returns a pointer
- to void, then explicitly coerce the pointer into the desired type with a cast.''
-
- Of course, the proper method is to leave it out if you like, as blessed by
- ANSI, and it is in fact preferrable.
-
- The one other fault I find with the book is that it gives the imporession
- that the standard library functions are ordinary C functions. It gives `` sample
- implementations'' of some of them, but without appropriate caveats.
-
- It leads programmers who haven't read the standard to believe that they
- can, for instance, write their own malloc() with external linkage.
- --
-
-